﻿#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat

FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1709 AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/dotnet:2.1-sdk-nanoserver-1709 AS build
WORKDIR /src
COPY NuGet.Config /
COPY ["src/FFF.Test/FFF.Test.csproj", "src/FFF.Test/"]
COPY ["src/FFF.Test/Nuget.Config", "src/FFF.Test/"]
COPY ["src/FFF.Test.Application/FFF.Test.Application.csproj", "src/FFF.Test.Application/"]
COPY ["src/FFF.Test.DataAccess/FFF.Test.DataAccess.csproj", "src/FFF.Test.DataAccess/"]
COPY ["src/FFF.Test.Entity/FFF.Test.Entity.csproj", "src/FFF.Test.Entity/"]
COPY ["src/FFF.Test.Util/FFF.Test.Util.csproj", "src/FFF.Test.Util/"]
RUN dotnet restore "src/FFF.Test/FFF.Test.csproj"
COPY . .
WORKDIR "/src/src/FFF.Test"
RUN dotnet build "FFF.Test.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "FFF.Test.csproj" -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "FFF.Test.dll"]